﻿using Dto;
using IBLL;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Model;

namespace ZY7.API.Controllers
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class MemberController : ControllerBase
    {
        public MemberController(IMemberBLL bll)
        {
            Bll = bll;
        }

        public IMemberBLL Bll { get; }
        [HttpPost]
        public async Task<int> AddMember(MemberModel member)
        {
            return await Bll.AddMember(member);

        }
        [HttpGet]
        public GetMemberPageDto GetMemberPage(int pageindex, int pagesize)
        {
            return Bll.GetMemberPage(pageindex, pagesize);
        }
        [HttpPost]
        public Task<int> UpdateMember(MemberModel member)
        {
            return Bll.UpdateMember(member);
        }
        [HttpGet]
        public MemberModel Ft(int id)
        {
            return Bll.Ft(id);
        }
    }
}
